//
// Created by richa on 2023/9/8.
//

#ifndef MICROBUBBLE_SIM_MODBUS_TCP_PLC_H
#define MICROBUBBLE_SIM_MODBUS_TCP_PLC_H

#include "SimPlc.h"
#include "../modbusTcp/ModbusTcp.h"

namespace Sim{
    class SimModbusTcpPlc {
    public:
        SimModbusTcpPlc(void (*function1)(), int listenPort, void(*init)(unsigned short * D));

        unsigned char * getM_Addr(){ return this->simPlc->getM_Addr();}
        unsigned char * getX_Addr(){return this->simPlc->getX_Addr();}
        unsigned char * getY_Addr(){return this->simPlc->getY_Addr();}
        unsigned short * getD_Addr(){return this->simPlc->getD_Addr();}

        std::mutex * getMutex(){ return this->simPlc->mutex; }
        SimPlc * getSimPlc(){return this->simPlc;}
    private:
        SimPlc * simPlc;
        ModbusTcp * modbusTcp;
    };
}



#endif //MICROBUBBLE_SIM_MODBUS_TCP_PLC_H
